package com.mingqi.enetconnected.net.request;

import android.content.Context;

import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.HashMap;

/**
 * 16102 UserRemoteService
 * 共1个，已完成
 */
public class UserRemoteOption {
    /**
     * 修改密码
     */
    public final static String MODIFY_PASSWORD = "/v1/uum/user/basicsetting/password";

    /**
     * 修改密码
     * @param cxt
     * @param oldPassWord   原密码
     * @param newPassWord   新密码
     */
    public static String modifyPassWord(Context cxt, String oldPassWord, String newPassWord) throws Exception {
        Type type = new TypeToken<String>() {
        }.getType();
        Communicator<String> communicator = new Communicator<>(cxt, MODIFY_PASSWORD);
        HashMap<String, String> params = new HashMap<>();
        params.put("oldPassWord", oldPassWord);
        params.put("newPassWord", newPassWord);
        return communicator.get(params, type);
    }
}
